<?php
if(!isset($_SESSION)) 
	{ 
		session_start(); 
	}
include '../operations/connection.php';

if ($_REQUEST['newlang'] == "EN") {
	include "../value/value_en.php";
} else if($_REQUEST['newlang'] == "VN") {
	include "../value/value_vn.php";
}
else {
	include "../value/value_kr.php";
}

if(!isset($_SESSION['user']))
	{
		header( 'Location: login.php' );
	}
	else 
	{		
		$username = $_SESSION['fullname'];
		$id_employee = $_SESSION['IDEmployee'];
	}

$loadboardhome = mysql_query("select e.UserName,e.IDEmployee, e.FullName,b.* from employee e, board b
					where e.IDEmployee = b.IDEmployee and b.Status = 1 order by b.CreatedDate desc");

$selectinforemp = mysql_query("SELECT UserName,FullName,Phone,DATE_FORMAT(Birthday,'%Y-%m-%d') as Birthday,Address,Email FROM employee WHERE IDEmployee ='$id_employee'");
$resultempl = mysql_fetch_assoc($selectinforemp);
$fullnamemp = $resultempl[FullName];
$phone = $resultempl[Phone];
$birthday = $resultempl[Birthday];
$address = $resultempl[Address];
$email = $resultempl[Email];
$us = $resultempl[UserName];
?>
<div class="nav_top" style="width: 100%;">
       		<div class="nav_tit"><?php echo $l_generalnotice;?></div>     
            <div class="rehome"><a href="mainPhone.php"><?php echo $l_menu?></a></div>       
       	</div>
		<div id="board-content" style="padding-top: 20px;">
				<img src="images/line1.png" width="100%" /><br /> <br /> 
			<table width="100%" style="border: 1px dotted silver;background-color: white;">
				<tr>
					<th width="5%"
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $l_no?></th>
					<th width="55%"
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $l_title?></th>
					<th width="17%"
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $l_createdby?></th>
					<th width="15%"
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $l_created_date?></th>
					<th width="8%" style="border-bottom: 1px dotted silver;"><?php echo $l_views?></th>
				</tr>
			
			 <?php $i=0;
					while ($row=mysql_fetch_array($loadboardhome)){
						$i++;
						$idboard = $row[ID];
						$rowtitle = $row[Title];
						$rowtitle = strip_tags($rowtitle);
						?>
				<tr>
					<td
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $i?>
					</td>
					<td
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver; padding-left: 5px;">
						<a href="#" onclick="processPreviewNotice('<?=$idboard?>',<?=$row[View]?>,this);"><?php echo substringProvider::catchuoi($rowtitle,30);?>
					</a><img src="images/ico_new_group.gif" height="11px" width="19px"
						style="margin: 0px 8px" /></td>
					<td
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;text-align: left;"><?php echo $row[FullName]?>
					</td>
					<td
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $row[CreatedDate]?>
					</td>
					<td
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $row[View]?>
					</td>
				</tr>
				<?php } ?>
			</table>
			<div class="login_succ" style="padding-top: 10px;">
				<div class="welcome" style="width: 100%;">
					<div class="tit_welcome"><?php echo $l_welcome?> <?php echo $us;?></div>
					<!-- 
					<ul style="padding-left: 0px">
						<li><img src="images/user.png" alt="" /><a href="#?w=350" rel="privateInformation" class="poplight"
							onclick="getviewprofile('<?=$fullnamemp?>','<?=$phone?>','<?=$email?>','<?=$address?>','<?=$birthday?>',this);"><?php echo $l_viewprofile?></a>
						</li>
						
						<li><img src="images/change_pass.png" alt="" /><a href="#?w=350" rel="changepassword" class="poplight"
							 onclick="onclickChangepass('','','',this);"><?php echo $l_changepassword?></a>
						</li>
						
						<li><img src="images/logout.png" alt="" /><a href="logout.php"><?php echo $l_logout?></a>
						</li>
						
					</ul>

					<div style="clear: both"></div>
					<div class="line_tit"></div>
					 -->
						<table class="main_page" cellspacing="20px" align="center">
							<tr>
								<td><img src="images/approval.png" alt="" /><a
									href="ApproveMain.php"><?php echo $l_e_approval?></a></td>
								<td><img src="images/project.png" alt="" />
								<a href="ProjectMain.php"><?php echo $l_project?></a>
								</td>
							</tr>
						</table>
				</div>
			</div>
		</div>
